package com.heima.admin.controller.v1;

import com.heima.admin.service.AdminLoginService;
import com.heima.model.admin.dtos.AdminUserDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ybw
 * @version 1.0
 * @date 2021/12/22 9:18
 */
@RestController
@RequestMapping("/login")
public class AdminLoginController {
  @Autowired private AdminLoginService adminLoginService;

  /**
   * 后台用户登录
   * @param adminUserDto
   * @return
   */
  @PostMapping("/in")
  public ResponseResult login(@RequestBody AdminUserDto adminUserDto) {
    return adminLoginService.login(adminUserDto);
  }
}
